#coding:utf-8
host = '120.132.101.30'

import pymongo


client = pymongo.MongoClient(host,27017)
db = client.survey_database

def check_collection(name):
    """
    检查指定集合的数据
    :param name: 
    :return: 
    """
    collection = db[name]
    rest = collection.find()
    # 计算总记录条数
    count = rest.count()
    print('记录总条数:%d'%count)
    for item in  collection.find():
        # print(item['response'])
        print(item)


if __name__ == '__main__':
    check_collection('responses_collection')

